package com.sy.core.shiro;

import com.sy.core.exception.AuthorizationException;
import com.sy.core.util.RestResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("autherror")
public class ErrorCtl {
    //公共错误跳转
    @RequestMapping("error")
    public RestResult autherror(int code) throws AuthorizationException {
        if(code==1){
            return new RestResult("401","请登录");
        }else{
            return new RestResult("203","权限不足");
        }

    }
}
